package com.itheima.mapper;

import com.itheima.common.entity.QueryPageBean;
import com.itheima.pojo.CheckGroup;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CheckgroupMapper {
    //分页查询
    List<CheckGroup> findPage(QueryPageBean queryPage);
    //新增
    void add(CheckGroup checkGroup);
    //根据id查询检查组
    @Select("select * from t_checkgroup where id = #{id}")
    CheckGroup findById(Integer id);
    //修改检查组
    void edit(CheckGroup checkGroup);
    //查询所有检查组
    @Select("select * from t_checkgroup")
    List<CheckGroup> findAll();
    //删除检查组
    @Delete("delete from t_checkgroup where id = #{id}")
    void delete(Integer id);

    //根据套餐id查询检查组id
    @Select("select checkgroup_id from t_setmeal_checkgroup  where setmeal_id=#{id}")
    List<Integer> findCheckGroupIdsBySetmealId(Integer setmealId);
}
